<template>
<div class="model-form">
    <el-page-header @back="goBack" content="详情">
    </el-page-header>

    <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
      <el-menu-item index="1">
        会员详情
      </el-menu-item>
      <el-menu-item index="2">
        报名的通告
      </el-menu-item>
      <el-menu-item index="3">
        积分记录
      </el-menu-item>
      <el-menu-item index="4">
        余额记录
      </el-menu-item>
      <el-menu-item index="5">
        冻结记录
      </el-menu-item>
    </el-menu>
    <div style="margin-top:15px;">
        <router-view></router-view>
    </div>

</div>
</template>

<script>
    import common from "@/mixins/common.js";

    export default {
        name: "model_layout_index",
        mixins: [common],
        data() {
            return {
                activeIndex: "1"
            }
        },
        methods: {
            handleSelect(index) {
                let selectId = this.selectId;
              if (index == "1") {
                this.$router.replace({
                  path: '/model/view',
                  query: {
                    id: selectId,
                    activeIndex: 1,
                    time: Math.random()
                  }
                })
              } else if (index == "2") {
                this.$router.replace({
                  path: '/model/view_join',
                  query: {
                    id: selectId,
                    activeIndex: 2,
                    time: Math.random()
                  }
                })
              } else if (index == "3") {
                this.$router.replace({
                  path: '/model/view_score',
                  query: {
                    id: selectId,
                    activeIndex: 3,
                    time: Math.random()
                  }
                })
              } else if (index == "4") {
                this.$router.replace({
                  path: '/model/view_money',
                  query: {
                    id: selectId,
                    activeIndex: 3,
                    time: Math.random()
                  }
                })
              }else if (index == "5") {
                this.$router.replace({
                  path: '/model/view_frozen',
                  query: {
                    id: selectId,
                    activeIndex: 3,
                    time: Math.random()
                  }
                })
              } else {
                console.log(index)
              }
            }
        },
        mounted() {
            let activeIndex = this.$route.query.activeIndex;
            this.selectId = this.$route.query.id;
            if (activeIndex) {
                this.activeIndex = activeIndex;
            }
        },
    }
</script>

<style scoped>

</style>
